import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    permissionControl:{},//权限控制
    user:{}//登录信息
  },
  getters:{
    getPermissionControl(state) {
      return state.permissionControl
    },
    getUser(state) {
      return state.user
    }
  },
  mutations: {
    setPermissionControl(state,value) {
      state.permissionControl = value
    },
    setUser(state,value) {
      state.user = value
    }
  },
  actions: {
    SETPERMISSIONCONTROL({commit},value){
      commit('setPermissionControl',value)
    },
    SETUSER({commit},value){
      commit('setUser',value)
    },
  },
  modules: {
  }
})
